package demo1;



public class Test1 {
    public static boolean func(String str){
        String str1 = str.toLowerCase() ;
        StringBuilder str2 = new StringBuilder() ;
        int len = str.length() ;
        for (int i = 0; i < len; i++) {
            char ch = str1.charAt(i) ;
            if(ch >= 'a' && ch <= 'z' || ch >='0'&& ch <='9'){
                str2.append(ch) ;
            }
        }
        str1 = str2.toString() ;
        str2.reverse() ;
        System.out.println(str1);
        System.out.println(str2);
       return str1.equals(str2.toString()) ;


    }
    public static void main(String[] args) {

        System.out.println(func("A man, a plan, a canal: Panama"));

    }
}
